// Storage 的方法封装

// const STORAGE_KEY = 'mall'

export default {
  setItem(key, STORAGE_KEY) {
    if (STORAGE_KEY.length == 0 || key) return null
    return window.sessionStorage.setItem(key, JSON.stringify(STORAGE_KEY))
  },
  getItem(STORAGE_KEY) {
    return JSON.parse(window.sessionStorage.getItem(STORAGE_KEY) || '{}')
  },
  // getStorage(STORAGE_KEY) {
  //   return JSON.parse(window.sessionStorage.getItem(STORAGE_KEY) || '{}')
  // },
  removeItem(key) {
    window.sessionStorage.removeItem(key)
  },
  // clear(key, module_name) {
  //   let val = this.getItem(key)
  //   if (module_name) {
  //     if (!val[module_name]) return
  //     // delete用于删除对象中的属性
  //     delete val[module_name][key]
  //   } else {
  //     delete val[key]
  //   }
  //   window.sessionStorage.removeItem(key)
  // },
  jumping(a){
  this.$router.push({path:a})
}
}

